<template>
  <el-container class="index-con">
    <el-aside :class="showclass">
      <leftnav></leftnav>
    </el-aside>
    <el-container class="main-con">
      <el-header style="padding: 0;">
        <navcon></navcon>
      </el-header>
      <el-main class="index-main">
        <!--<el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>{{ $route.name }}</el-breadcrumb-item>
        </el-breadcrumb>-->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// 导入组件
import navcon from "../components/navcon.vue";
import leftnav from "../components/leftnav.vue";
export default {
  name: "index",
  data() {
    return {
      showclass: "asideshow",
      showtype: false
    };
  },
  // 注册组件
  components: {
    navcon,
    leftnav
  },

  created() {
    // 监听
    this.$root.Bus.$on("toggle", value => {
      if (value) {
        console.log("toggle", value);
        this.showclass = "asideshow";
      } else {
        setTimeout(() => {
          this.showclass = "aside";
        }, 100);
      }
    });
  }
};
</script>
<style>
.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.aside {
  width: 90px !important;
  height: 100%;
  background-color: #fff;
  margin: 0px;
  padding: 0 !important;
}
.asideshow {
  width: 250px !important;
  /* background:-webkit-linear-gradient(left,rgb(93, 123, 106),rgb(111, 110, 188)) !important; */
  background-color: #fff;
  box-shadow: 3px 3px 6px rgba(123, 117, 117, 0.9);
  margin: 0px;
}
.index-header,
.index-main {
  padding: 0px;
  margin: 10px;
  /* border-left: 2px solid #333; */
  /*height: 100vh !important;*/
}
</style>
